package com.qingcheng.timer;

import com.qingcheng.service.CategoryReportService;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.jni.Local;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class CateGoryTimer {

    @Autowired
    private CategoryReportService categoryReportService;

    @Scheduled(cron = "0 0 1 * * ?")
    public void createCategoryReport(){
        log.info("生成类目统计数据");
        categoryReportService.createData();
    }
}
